package com.lw.client;

import com.lw.server.ServerConnectClientThread;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 管理客户端和服务器端通信的线程
 */
public class ManageClientConnectServerThread {
    /**
     * 保存客户端连接线程 key:用户ID，value:线程
     */
    private static HashMap<String,ClientConnectServerThread> threadHashMap = new HashMap<>();

    public static void addClientConnectServerThread(String userId,ClientConnectServerThread thread){
        threadHashMap.put(userId,thread);
    }

    public static ClientConnectServerThread getClientConnectServerThread(String userId){
        return threadHashMap.get(userId);
    }
}
